<?php
namespace app\home\controller;
use app\common\controller\Home;	
use think\Request;
class Up extends Home{  
    public function show(){
		$param = zanpiancms_param_url();
		$month=input('month/d',date('Ym')).'01';
		$lastday=date('Y-m-d', strtotime("$month +1 month -1 day"));
		$firstday = date("Ym01",strtotime($month));	
        for($x=1;$x<5;$x++){
		    $lastdate[]=strtotime("-".$x." month",strtotime($firstday));
            $update[]=strtotime("+".$x." month",strtotime($firstday));		
		}
		krsort($lastdate);
		$list=F('_data/list_all');
		if($param['dir']){
			$param['id'] = getlist($param['dir'],'list_dir','list_id');
		}
		$array_list=$list[$param['id']];
		if($array_list){
		    if($param['type']){
				config('params',array('id'=>$array_list['list_id'],'dir'=>$array_list['list_dir'],'type'=>$param['type'],'p'=>'[PAGE]'));
		    }else{
				config('params',array('id'=>$array_list['list_id'],'dir'=>$array_list['list_dir'],'month'=>date('Ym',strtotime($month)),'p'=>'[PAGE]'));	
		    }		
            if($array_list['list_id']==2){
			    $up_title="播出"; 
		    }else{
			    $up_title="上映";  
		    }			
	        $this->assign('param',$param);
		    $this->assign('show',$array_list);
		    $this->assign('lastdate',$lastdate);
            $this->assign('update',$update);
            $this->assign('month',strtotime($month));	
            $this->assign('firstday',strtotime($firstday));	
            $this->assign('lastday',strtotime($lastday));	
            $this->assign('up_title',$up_title);			
		    return $this->fetch(DS.'up_list');
		}
    }
}
// +----------------------------------------------------------------------
// | ZanPianCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.zanpian.com All rights reserved.
// +----------------------------------------------------------------------
// | BBS:  <http://www.feifeicms.cc>
// +----------------------------------------------------------------------
